<?php
/**
 * Created by PhpStorm.
 * User: baidu
 * Date: 17/8/5
 * Time: 下午4:37
 */
namespace app\api\controller\v1;

use app\api\controller\v1\AuthBase;
use think\Controller;
use app\common\lib\exception\ApiException;
use app\common\lib\Aes;
use app\common\lib\Upload;

/**
 * 客户端auth登录权限基础类库
 * 1.每个接口(需要登录 个人中心  点赞 评论) 都需要去集
 * 2.判定access_user_token是否合法
 * 3.用户信息->>user
 */
class Image extends AuthBase {

  public function save(){
    $file = request()->file('image');
    $info = Upload::upload($file);
    if ($info['status'] == 1) {
      return show(config('code.success'),'ok',$info['info'],200);
    }else{
      return show(config('code.error'),$info['info'],'',404);
    }
  }

}